from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import Library, Node, TemplateSyntaxError, VariableDoesNotExist
from operate.models import *

register = Library()


@register.filter
def collect(book, user):
    c = Collect.objects.filter(book=book, user=user).first()
    return True if c else False
